import axios from "axios";

const http = axios.create({
  baseURL: "/api",
  timeout: 10000,
});
// request拦截器
http.interceptors.request.use(
  function (config) {
    return config;
  },
  function (error) {
    return Promise.reject(error);
  }
);

// response拦截器
http.interceptors.response.use(
  function (response) {
    return response;
  },
  function (error) {
    return Promise.reject(error);
  }
);

export default http;
